package com.liuh.appsys.service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import com.liuh.appsys.tools.MyConstants;

/**
 * @note 登陆拦截处理
 * @author liuh
 * */
public class LoginInterHandler extends HandlerInterceptorAdapter{

	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		Object obj= request.getSession().getAttribute(MyConstants.DEV_USER_SESSION);
		if(null==obj) {
			//未登陆
			response.sendRedirect(request.getContextPath()+"/dev/loginV");
			return false;
		}
		return true;
	}

	
}
